package com.jic.market.mapper.skill;

import com.jic.market.entity.skill.SkillActivityConfig;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 秒杀基础信息配置表
 *
 * @author : seven
 * @version : v1.0.0
 * @email : 774329481@qq.com
 * @since : 2020-03-12 04:31:17
 */
@Repository
public interface SkillActivityConfigMapper {

    long insert(SkillActivityConfig skillActivityConfig);

    long delete(@Param("promotionId") String promotionId);

    long update(SkillActivityConfig skillActivityConfig);

    SkillActivityConfig queryByPrimaryKey(Long id);

    List<SkillActivityConfig> query(SkillActivityConfig skillActivityConfig);

    List<SkillActivityConfig> queryPage(@Param("startIndex") int startIndex, @Param("limit") int limit, @Param("skillActivityConfig") SkillActivityConfig skillActivityConfig);

    long queryPageCount(SkillActivityConfig skillActivityConfig);

    @Select("select * from market_skill_activity_config where promotion_id=#{promotionId} and delete_flag='0'")
    SkillActivityConfig queryByPromotionId(@Param("promotionId")String promotionId);

    @Update("update market_skill_activity_config set images_urls=#{imagesUrls} where promotion_id=#{promotionId} and delete_flag='0'")
    long updateImagesUrlByPromotionId(@Param("promotionId")String promotionId,
                                      @Param("imagesUrls")String imagesUrls);
}